#include<iostream>
using namespace std;

class Solution 
{
public:
    int hammingDistance(int x, int y)
    {
        x ^= y;
        int count = 0;
        while (x)
        {
            x &= (x - 1);
            count++;
        }
        return count;
    }
};

int main()
{
    int x, y;
    cin >> x >> y;
    Solution solution;
    int ret =solution. hammingDistance(x, y);
    cout << ret << endl;
    return 0;
}